Brock Purdy threw for 262 yards, Demarcus Robinson picked up 111 receiving yards and a touchdown, and Christian McCaffrey recorded 114 yards and a touchdown to lead the San Francisco 49ers to a 23-19 win over the Philadelphia Eagles.